<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="includes/head.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Phones</title>
</head>
<body>
	<span id="whole-page-wrapper">
			<div id="wrapper" align="center">
			<%@include file="includes/header.jsp" %>
			<%@include file="includes/menu.jsp" %>	
					
				<div id="content">
					<div id="inner-content">
					
						<h3>Szczegółowe dane telefonu</h3>
						
							<div class="leftIndent50px">
								<h4> Model: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].model}</span><br>
								<h4> Cena: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].price} zł</span><br>
								<h4> Wytrzymałość (skala 1-10): </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].hardiness}</span><br>
								<h4> Aparat (skala 1-10): </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].camera}</span><br>
								<h4> Wysokość: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].height} mm</span><br>
								<h4> Szerokość: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].width} mm</span><br>
								<h4> Grubość: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].depth} mm</span><br>
								<h4> Waga: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].weight} g</span><br>
								<h4> Ilość kolorów wyświetlacza: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].colors} milionów kolorów</span><br> 
								<h4> Rozdzielczość wyświetlacza: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].resolution}</span><br>
								<h4> Rozmiar wyświetlacza: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].screenSize}"</span><br>
								<h4> Czas rozmów (2g): </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].talkTime2g} godzin</span><br>
								<h4> Czas rozmów (3g): </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].talkTime3g} godzin</span><br>
								<h4> Czas czuwania (2g): </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].standBy2g} dni</span><br>
								<h4> Czas czuwania (3g): </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].standBy3g} dni</span><br>
								<h4> Pamięć wbudowana: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].buildInMem} GB</span><br>
								<h4> Pamięć RAM: </h4> 
									<span class="leftIndent30px">${sessionScope.phones[param.id].ram} MB</span><br>
								<h4> Maksymalny rozmiar karty pamięci: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].maxCardSize} GB</span><br>
								<h4> Ilość aplikacji (skala 1-10): </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].nrOfApp}</span><br>
								<h4> Taktowanie procesora: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].procClock} GHz</span><br>
								<h4> Na rynku od: </h4> <c:set var="year">${sessionScope.phones[param.id].releaseDate}</c:set>
									<span class="leftIndent30px">
									<c:if test="${year.length() > 0}">
									${year.charAt(0)}
									</c:if>
									<c:if test="${year.length() > 1}">
									${year.charAt(1)}
									</c:if>
									<c:if test="${year.length() > 2}">
									${year.charAt(2)}
									</c:if>
									<c:if test="${year.length() > 3}">
									${year.charAt(3)}
									</c:if>
									r.</span><br>
								<h4> Popularność: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].popularity}%</span><br>
								<h4> Łączność: </h4> <c:set var="hsdp">${sessionScope.phones[param.id].getHsdpaitdAsString()}</c:set>
									<span class="leftIndent30px"> 
									<c:if test="${sessionScope.phones[param.id].getHsdpaitdAsString().charAt(0)=='1'.charAt(0)}">
									HSDPA
									</c:if>
									<c:if test="${sessionScope.phones[param.id].getHsdpaitdAsString().length()>1}" >
										<c:if test="${sessionScope.phones[param.id].getHsdpaitdAsString().charAt(1)=='1'.charAt(0)}">
										HSUPA
										</c:if>
										<c:if test="${sessionScope.phones[param.id].getHsdpaitdAsString().charAt(2)=='1'.charAt(0)}">
										HSPA
										</c:if>
										<c:if test="${sessionScope.phones[param.id].getHsdpaitdAsString().charAt(3)=='1'.charAt(0)}">
										HSPA+
										</c:if>
										<c:if test="${sessionScope.phones[param.id].getHsdpaitdAsString().charAt(4)=='1'.charAt(0)}">
										WIFI
										</c:if>
									</c:if>
									  </span><br>
								<h4> GorillaGlass: </h4> <c:set var="grl">${sessionScope.phones[param.id].gorillaglass}</c:set>
									<span class="leftIndent30px">
									<c:if test="${grl.charAt(0)=='1'.charAt(0) }" >
										TAK
									</c:if>
									<c:if test="${grl.charAt(0)=='0'.charAt(0) }" >
										NIE
									</c:if>
									</span>
									<br>
								<h4> Wygląd: </h4>
									<span class="leftIndent30px">${sessionScope.phones[param.id].design} </span><br>
								<h4> Autofocus: </h4> <c:set var="af">${sessionScope.phones[param.id].autofocus}</c:set>
									<span class="leftIndent30px">
									<c:if test="${af.charAt(0)=='1'.charAt(0) }" >
										TAK
									</c:if>
									<c:if test="${af.charAt(0)=='0'.charAt(0) }" >
										NIE
									</c:if>
									</span>
									<br>
							</div>
						<c:if test="${sessionScope.user != null }">
							<c:if test="${sessionScope.user.type == 'Admin' }">
								<br>
								<form action="removePhone" method="POST">
								<input type="hidden" value="${sessionScope.phones[param.id].phoneId }" name="phoneID" />
								<input type="submit" value="Usuń telefon z bazy danych" />
								</form>
							</c:if>
							<c:if test="${sessionScope.user.type == 'User' }">
								<br>
								<form action="addToCart" method="POST">
								<input type="hidden" value="${param.id }" name="index" />
								<input type="submit" value="Dodaj do koszyka" />
								</form>
							</c:if>
						</c:if>
					</div>
				</div>
				<%@include file="includes/footer.jsp" %>
			</div>
		</span>
</body>
</html>